Skip to content

chore: standardize repository config#786

Open
afc163 wants to merge 31 commits into
masterfrom
codex/standardize-rc-config
Open

chore: standardize repository config#786
afc163 wants to merge 31 commits into
masterfrom
codex/standardize-rc-config

Conversation

@afc163

@afc163 afc163 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Standardize this rc-component repository as part of the Ant Design rc-component maintenance sweep.

Tracking issue: ant-design/ant-design#58514

Scope

  • Redesign README.md and README.zh-CN.md with centered title, Ant Design ecosystem branding, aligned badges, scoped Bundlephobia badge, install command, Usage, Development, Release, and License sections.
  • Standardize package metadata, GitHub repo metadata, npm package name, package entry fields, types: "./es/index.d.ts", publishConfig, and release flow through @rc-component/np.
  • Align shared dependencies and scripts for React, testing-library, Jest/Vitest where existing, TypeScript, ESLint, Prettier, Less, dumi, father, Husky, lint-staged, and Dependabot.
  • Use the shared react-component/rc-test/.github/workflows/test-utoo.yml@main workflow, React Doctor, Codecov, CodeQL, updated GitHub Actions versions, and guarded Surge preview fallback.
  • Keep Vercel preview configuration compatible with docs-dist output and remove legacy now-build / Cloudflare Pages residue.
  • Keep API docs, demos, tests, TypeScript checks, funding metadata, and npm package files aligned with the repository standardization matrix.

Notes

  • No breaking runtime behavior is intended.
  • React peer dependency ranges are preserved when narrowing them would be a breaking change.
  • secrets: inherit is kept until react-component/rc-test#176 is merged, then it can be narrowed to explicit CODECOV_TOKEN forwarding.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
util Building Building Preview, Comment Jun 28, 2026 5:47am

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-util-preview-pr-786.surge.sh (may be unavailable)
📝 Commit2708a46
🪵 LogsView logs
📋 Build log (last lines)
npm warn exec The following package was not found and will be installed: surge@0.27.4

   Running as afc163@gmail.com (Student)

        project: ./docs-dist
         domain: react-component-util-preview-pr-786.surge.sh
           size: 44 files, 1.5 MB

   Aborted - you do not have permission to publish to react-component-util-preview-pr-786.surge.sh

🤖 Powered by surge-preview

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

将构建、文档、示例与 GitHub 自动化配置切换到 @rc-component/util 相关路径和新的输出目录,并同步更新包脚本、路径映射、部署预览与仓库维护配置。

Changes

包与构建配置更新

Layer / File(s) Summary
构建与路径配置
.dumirc.ts, tsconfig.json, package.json, .gitignore, vercel.json
构建输出改为 docs-distGH_PAGES 控制 base/publicPath,路径别名同时覆盖 @rc-component/utilrc-util,并同步更新脚本、忽略规则和 Vercel 构建配置。

文档与示例迁移

Layer / File(s) Summary
文档总览重写
README.md, README.zh-CN.md, docs/index.md
README 和文档首页切换到 @rc-component/util 品牌,并改写安装、使用、API 总览和许可内容。
示例导入迁移
docs/examples/*.tsx
示例文件的导入路径从 rc-util 切换到 @rc-component/util,并对 portaltoArray 示例的渲染结构做了对应调整或格式化。

GitHub 自动化更新

Layer / File(s) Summary
GitHub 自动化更新
.github/FUNDING.yml, .github/dependabot.yml, .github/workflows/*.yml
资金支持、Dependabot、CodeQL、复用测试、doctor 预览和 Surge 预览工作流都被更新。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

(_/)
(•_•) 兔耳一抖来巡山,
@rc-component/util 跳进新草篮。
docs-dist 亮晶晶,工作流轻轻转,
我把胡萝卜味的代码,送上云端。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了本次以仓库配置标准化、文档和 CI 工作流调整为主的变更。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/standardize-rc-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no issues. 🎉

Reviewed by React Doctor for commit 2708a46.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the repository to use the scoped package name @rc-component/util, updates documentation, and refactors build, deployment, and configuration files (including Dumi, TypeScript, and GitHub Actions). Feedback suggests using __dirname for robust path resolution and removing redundant wildcard aliases in .dumirc.ts. Additionally, it is recommended not to ignore the entire .dumi directory in .gitignore to avoid untracking important configuration and theme files.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .dumirc.ts
Comment thread .gitignore
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.42%. Comparing base (b7731c3) to head (2708a46).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #786   +/-   ##
=======================================
  Coverage   86.42%   86.42%           
=======================================
  Files          39       39           
  Lines        1068     1068           
  Branches      388      380    -8     
=======================================
  Hits          923      923           
  Misses        143      143           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/react-component-ci.yml:
- Around line 14-15: The reusable workflow invocation in the CI workflow is too
permissive and uses a mutable reference. Update the workflow call in the rc-test
reuse block to pass only the required secrets explicitly instead of using
secrets: inherit, and change the workflow reference from `@main` to a pinned
commit SHA to match the other fixed action references.

In `@docs/examples/portal.tsx`:
- Line 2: The example in PortalWrapper import is invalid because the module path
and default export do not exist; update the import in portal.tsx to use the
actual Portal component export instead. Use the Portal/PortalWrapper reference
in this example file to locate the statement, and change it to import from the
Portal module or the package’s main entry so the demo resolves correctly.

In `@README.md`:
- Around line 37-41: The Usage example imports `raf` and `Portal` from deep
paths even though the API guidance recommends using the public entry point;
update the example to import both from `@rc-component/util` via the main export
path. Keep any deep-path import examples only for symbols that are not
re-exported from the main entry, and make sure the README example matches the
export structure exposed by `src/index.ts`.
- Around line 59-60: README 的 React utilities 总览与示例中的 Portal 公开 API 不一致,需要统一。请检查
`PortalWrapper` 和 `Portal` 的实际导出关系:如果 `PortalWrapper` 是公开接口,就在 README 的 React
utilities 表格中补充它或注明子路径导入方式;如果标准接口应为 `Portal`,则同步更新 `docs/examples/portal.tsx`
中的使用方式并移除对 `PortalWrapper` 的依赖,确保文档与示例一致。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2fd6df3d-b712-40f3-9050-ef98f9f962d2

📥 Commits

Reviewing files that changed from the base of the PR and between b7731c3 and 97b9b13.

📒 Files selected for processing (19)
  • .dumirc.ts
  • .github/FUNDING.yml
  • .github/dependabot.yml
  • .github/workflows/codeql.yml
  • .github/workflows/react-component-ci.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/site-deploy.yml
  • .github/workflows/surge-preview.yml
  • .gitignore
  • README.md
  • docs/examples/dynaymicCSS.tsx
  • docs/examples/getScrollBarSize.tsx
  • docs/examples/portal.tsx
  • docs/examples/styleChecker.tsx
  • docs/examples/toArray.tsx
  • docs/index.md
  • package.json
  • tsconfig.json
  • vercel.json
💤 Files with no reviewable changes (1)
  • .github/workflows/site-deploy.yml

Comment thread .github/workflows/react-component-ci.yml
Comment thread docs/examples/portal.tsx Outdated
Comment thread README.md
Comment thread README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/examples/portal.tsx (1)

8-10: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

移除遗留的调试 console.log effect。

该 effect 使用空依赖数组,仅在挂载时执行一次;此时 container 仍为 nullPortal 尚未渲染,divRef.current 始终为 null,因此该日志没有实际意义,疑似遗留的调试代码。

♻️ 建议移除
-  React.useEffect(() => {
-    console.log('>>>', divRef.current);
-  }, []);
-
   React.useEffect(() => {
     const element = document.createElement('div');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/portal.tsx` around lines 8 - 10, Remove the leftover debug
effect in Portal by deleting the React.useEffect that logs divRef.current with
an empty dependency array; the effect in portal.tsx is not useful because
divRef.current stays null on mount before Portal renders. Keep the Portal/divRef
setup intact and ensure no console.log debug code remains in this component.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/react-component-ci.yml:
- Around line 14-15: The reusable workflow invocation currently inherits all
secrets, but it only needs CODECOV_TOKEN; update the workflow call in the CI
config by replacing secrets: inherit with an explicit secrets mapping for
CODECOV_TOKEN, using the existing secrets reference, so the called test-utoo.yml
workflow receives only the required credential.

---

Nitpick comments:
In `@docs/examples/portal.tsx`:
- Around line 8-10: Remove the leftover debug effect in Portal by deleting the
React.useEffect that logs divRef.current with an empty dependency array; the
effect in portal.tsx is not useful because divRef.current stays null on mount
before Portal renders. Keep the Portal/divRef setup intact and ensure no
console.log debug code remains in this component.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47aa181d-1510-4ad3-a324-22d34e3ab7c1

📥 Commits

Reviewing files that changed from the base of the PR and between 97b9b13 and f89eb65.

📒 Files selected for processing (7)
  • .dumirc.ts
  • .github/workflows/react-component-ci.yml
  • .github/workflows/surge-preview.yml
  • .gitignore
  • README.md
  • docs/examples/portal.tsx
  • docs/examples/toArray.tsx
💤 Files with no reviewable changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/surge-preview.yml
  • README.md
  • docs/examples/toArray.tsx

Comment thread .github/workflows/react-component-ci.yml Outdated
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/afc163s-projects?upgradeToPro=build-rate-limit

@socket-security

socket-security Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​types/​jest@​30.0.0 ⏵ 29.5.14100 +110077 +180100
Addednpm/​gh-pages@​6.3.09910010082100
Addednpm/​@​testing-library/​react@​15.0.710010010087100
Addednpm/​lint-staged@​16.4.010010010097100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/surge-preview.yml (1)

33-34: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

把依赖安装也挂到 enabled 条件下。

SURGE_TOKEN 缺失时,Line 36 和 Line 39 都已经跳过了,但 Line 33 仍会执行完整的 npm install。对 fork PR 来说这一步通常没有产出,只会增加 CI 时间和网络开销。

♻️ 建议修改
       - name: Install dependencies
+        if: ${{ steps.surge-token.outputs.enabled == 'true' }}
         run: npm install --legacy-peer-deps --ignore-scripts --no-audit --loglevel=warn
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/surge-preview.yml around lines 33 - 34, The dependency
installation step still runs even when SURGE_TOKEN is missing, so gate the
“Install dependencies” step in surge-preview.yml behind the same enabled
condition used by the later surge steps. Update the workflow so the npm install
step only executes when the preview is actually enabled, using the existing
enabled logic/variable in this job to keep fork PRs from doing unnecessary work.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 54-76: `package.json` 里的依赖已经提升了运行时要求,但还没有显式的 Node 版本约束;请在
`package.json` 中补上与 `@types/node`, `cross-env`, `glob`, `lint-staged` 等兼容的
`engines.node`,并同步检查 CI/`setup-node` 的版本声明,确保本地与流水线都使用同一最低 Node 版本。

---

Nitpick comments:
In @.github/workflows/surge-preview.yml:
- Around line 33-34: The dependency installation step still runs even when
SURGE_TOKEN is missing, so gate the “Install dependencies” step in
surge-preview.yml behind the same enabled condition used by the later surge
steps. Update the workflow so the npm install step only executes when the
preview is actually enabled, using the existing enabled logic/variable in this
job to keep fork PRs from doing unnecessary work.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d52ece8a-7fe6-4fbe-972c-a919825afe16

📥 Commits

Reviewing files that changed from the base of the PR and between f89eb65 and 0ac6877.

📒 Files selected for processing (8)
  • .dumirc.ts
  • .github/workflows/codeql.yml
  • .github/workflows/surge-preview.yml
  • README.md
  • README.zh-CN.md
  • docs/examples/portal.tsx
  • package.json
  • tsconfig.json
💤 Files with no reviewable changes (1)
  • docs/examples/portal.tsx
✅ Files skipped from review due to trivial changes (3)
  • README.zh-CN.md
  • .dumirc.ts
  • README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/codeql.yml
  • tsconfig.json

Comment thread package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant